from flask import Blueprint
from .auth.route import auth_bp
from .products.route import products_bp
from .warehouses.route import warehouses_bp
from .orders.route import orders_bp
from .logistics.route import logistics_bp
from .reports.route import reports_bp
from .test.route import test
from .upload.route import upload
from .user.route import user
from handle.S2Redis import sync_data_background,render_template,redis_client,socketio

api_bp = Blueprint('api', __name__)

# 注册所有子蓝图
api_bp.register_blueprint(auth_bp, url_prefix='/auth')
api_bp.register_blueprint(products_bp, url_prefix='/products')
api_bp.register_blueprint(warehouses_bp, url_prefix='/warehouses')
api_bp.register_blueprint(orders_bp, url_prefix='/orders')
api_bp.register_blueprint(logistics_bp, url_prefix='/logistics')
api_bp.register_blueprint(reports_bp, url_prefix='/reports')
api_bp.register_blueprint(test, url_prefix='/test')
api_bp.register_blueprint(upload, url_prefix='/upload')
api_bp.register_blueprint(user, url_prefix='/user')